package com.gxuwz.xmlrw;

import java.io.File;  
import org.dom4j.Document;  
import org.dom4j.Element;  
import org.dom4j.io.SAXReader;

public class SaxReader {
	public static void main(String args[])throws Exception{ 
    //创建解析对象  
    SAXReader reader = new SAXReader();  

    //读取xml文件  
    Document document = reader.read(new File("student.xml"));  


    //获取根节点  
    Element roote = document.getRootElement();  
    //获取根节点下面的子节点  
    String childe = roote.elementText("学生");  
    System.out.println(roote.getName());  
    System.out.println(childe);  
	}
}
